home *** CD-ROM | disk | FTP | other *** search
/ Print Library / Print Library.iso / library / shared.dir / 00988.ls < prev    next >
Encoding:
Text File  |  1995-08-22  |  12.1 KB  |  462 lines

  1. on usequit
  2.   set theSp to the clickOn
  3.   puppetSound("Click")
  4.   set the castNum of sprite theSp to 999
  5.   updateStage()
  6.   repeat while the stillDown
  7.   end repeat
  8.   set the locV of sprite 48 to 240
  9.   updateStage()
  10.   set theEndTime to the timer + 300
  11.   repeat while the timer <= theEndTime
  12.     if the mouseDown then
  13.       exit repeat
  14.     end if
  15.   end repeat
  16.   puppetSound(0)
  17.   closeXLib()
  18.   quit()
  19. end
  20.  
  21. on usemenu theFName
  22.   set theSp to the clickOn
  23.   puppetSound("Click")
  24.   set the castNum of sprite theSp to 998
  25.   updateStage()
  26.   repeat while the stillDown
  27.   end repeat
  28.   set the castNum of sprite theSp to 994
  29.   updateStage()
  30.   puppetSound(0)
  31.   go(theFName)
  32. end
  33.  
  34. on usehelp
  35.   set theSp to the clickOn
  36.   puppetSound("Click")
  37.   set the castNum of sprite theSp to 997
  38.   updateStage()
  39.   repeat while the stillDown
  40.   end repeat
  41.   set the castNum of sprite theSp to 993
  42.   updateStage()
  43.   puppetSound(0)
  44. end
  45.  
  46. on useinfo
  47.   set theSp to the clickOn
  48.   puppetSound("Click")
  49.   set the castNum of sprite theSp to 996
  50.   updateStage()
  51.   repeat while the stillDown
  52.   end repeat
  53.   puppetSound(0)
  54.   go("Info")
  55. end
  56.  
  57. on ResetAllPuppets
  58.   repeat with e = 1 to 48
  59.     puppetSprite(e, 0)
  60.   end repeat
  61. end
  62.  
  63. on DialogwithMouse
  64.   if not rollOver(27) then
  65.     beep()
  66.     dontPassEvent()
  67.   end if
  68. end
  69.  
  70. on BuildPrinterTitle
  71.   global gNowMode
  72.   set the castNum of sprite 7 to cast gNowMode
  73.   set the locV of sprite 7 to 54
  74.   updateStage()
  75.   puppetSprite(7, 1)
  76. end
  77.  
  78. on BuildArtButtons
  79.   global gPageNumber, gTableL, gTotalPage
  80.   set gPageNumber to 1
  81.   set theCount to count(gTableL)
  82.   set gTotalPage to GetNumOfPages(theCount)
  83.   UpdateArtButtons()
  84.   puppetSprite(26, 1)
  85.   puppetSprite(34, 1)
  86.   puppetSprite(35, 1)
  87. end
  88.  
  89. on GetNumOfPages theTotalEntry
  90.   set theRepCount to 1
  91.   set theNowEntrys to theTotalEntry
  92.   repeat while the maxinteger
  93.     set theNowEntrys to theNowEntrys - 6
  94.     if theNowEntrys <= 0 then
  95.       exit repeat
  96.       next repeat
  97.     end if
  98.     set theRepCount to theRepCount + 1
  99.   end repeat
  100.   return theRepCount
  101. end
  102.  
  103. on UpdateArtButtons
  104.   global gPageNumber, gTableL, gTotalPage
  105.   if gTotalPage >= 2 then
  106.     if gPageNumber = 1 then
  107.       set the locV of sprite 34 to 1000
  108.       set the locV of sprite 35 to 240
  109.     else
  110.       if gPageNumber = gTotalPage then
  111.         set the locV of sprite 34 to 240
  112.         set the locV of sprite 35 to 1000
  113.       else
  114.         set the locV of sprite 34 to 240
  115.         set the locV of sprite 35 to 240
  116.       end if
  117.     end if
  118.   else
  119.     set the locV of sprite 34 to 1000
  120.     set the locV of sprite 35 to 1000
  121.   end if
  122.   set theCount to count(gTableL)
  123.   set theHList to "282,385,489,282,385,489"
  124.   set theVList to "106,106,106,238,238,238"
  125.   repeat with e = 1 to 6
  126.     set theE to ((gPageNumber - 1) * 6) + e
  127.     set the locV of sprite (e + 19) to 1000
  128.     if theCount >= theE then
  129.       set theCastName to item 4 of getAt(gTableL, theE)
  130.       set the castNum of sprite (e + 19) to cast theCastName
  131.       set the locH of sprite (e + 19) to value(item e of theHList)
  132.       set the locV of sprite (e + 19) to value(item e of theVList)
  133.     end if
  134.     puppetSprite(e + 19, 1)
  135.   end repeat
  136.   updateStage()
  137. end
  138.  
  139. on ClickPageSlider
  140.   global gPageNumber
  141.   puppetSound("Click")
  142.   if the clickOn = 34 then
  143.     set the castNum of sprite 34 to cast "PREV_BU.H"
  144.     updateStage()
  145.     repeat while the stillDown
  146.     end repeat
  147.     set gPageNumber to gPageNumber - 1
  148.     set the castNum of sprite 34 to cast "PREV_BU"
  149.   else
  150.     set the castNum of sprite 35 to cast "NEXT_BU.H"
  151.     updateStage()
  152.     repeat while the stillDown
  153.     end repeat
  154.     set gPageNumber to gPageNumber + 1
  155.     set the castNum of sprite 35 to cast "NEXT_BU"
  156.   end if
  157.   updateStage()
  158.   UpdateArtButtons()
  159. end
  160.  
  161. on ResetArtButtons
  162.   set thePuppetList to "20,21,22,23,24,25,26,34,35"
  163.   repeat with e = 1 to 9
  164.     set theSp to value(item e of thePuppetList)
  165.     set the locV of sprite theSp to 1000
  166.     puppetSprite(theSp, 0)
  167.   end repeat
  168.   updateStage()
  169. end
  170.  
  171. on ClickArtButton
  172.   global gTableL, gTargetPRNfile, gTargetDLGcast, gTargetTEXTcount, gMachineType, gTargetTEXTprn, gPageNumber, gTotalPage
  173.   puppetSound("Click")
  174.   set theHList to "282,385,489,282,385,489"
  175.   set theVList to "106,106,106,238,238,238"
  176.   set theSp to the clickOn
  177.   set the locH of sprite 26 to value(item theSp - 19 of theHList)
  178.   set the locV of sprite 26 to value(item theSp - 19 of theVList)
  179.   updateStage()
  180.   repeat while the stillDown
  181.   end repeat
  182.   set thep to theSp - 19 + ((gPageNumber - 1) * 6)
  183.   set theTargetData to getAt(gTableL, thep)
  184.   set gTargetPRNfile to item 2 of theTargetData
  185.   set gTargetDLGcast to item 3 of theTargetData
  186.   set gTargetTEXTcount to value(item 5 of theTargetData)
  187.   if gMachineType = "PC" then
  188.     if gTargetTEXTcount >= 2 then
  189.       go("Dialog-1")
  190.     else
  191.       if gTargetTEXTcount = 1 then
  192.         set gTargetTEXTprn to char 1 to 3 of gTargetPRNfile & "_1"
  193.         go("Dialog-2")
  194.       else
  195.         set gTargetTEXTprn to EMPTY
  196.         go("Dialog-2")
  197.       end if
  198.     end if
  199.   else
  200.     set gTargetTEXTprn to EMPTY
  201.     go("Dialog-2")
  202.   end if
  203.   puppetSound(0)
  204. end
  205.  
  206. on BuildTEXTDialog
  207.   global gTargetTEXTcount, gTargetPRNfile, gTargetTEXTprn
  208.   set theVList to "196,223,250"
  209.   repeat with e = 1 to gTargetTEXTcount
  210.     set theCastName to char 1 to 3 of gTargetPRNfile & "_" & string(e)
  211.     set the castNum of sprite (27 + e) to cast theCastName
  212.     set the locV of sprite (27 + e) to value(item e of theVList)
  213.     puppetSprite(e + 27, 1)
  214.   end repeat
  215.   set gTargetTEXTprn to char 1 to 3 of gTargetPRNfile & "_1"
  216.   set the locV of sprite 31 to 196
  217.   puppetSprite(31, 1)
  218.   updateStage()
  219.   set the mouseDownScript to "DialogwithMouse"
  220. end
  221.  
  222. on ResetTEXTDialog
  223.   repeat with e = 28 to 31
  224.     set the locV of sprite e to 1000
  225.     puppetSprite(e, 0)
  226.   end repeat
  227.   updateStage()
  228. end
  229.  
  230. on ClickTEXTDialog
  231.   global gTargetPRNfile, gTargetTEXTprn
  232.   set theVList to "196,223,250"
  233.   set theSp to the clickOn
  234.   set the locV of sprite 31 to value(item theSp - 27 of theVList)
  235.   updateStage()
  236.   set gTargetTEXTprn to char 1 to 3 of gTargetPRNfile & "_" & theSp - 27
  237. end
  238.  
  239. on BuildPageDialog
  240.   global gTargetDLGcast
  241.   put "1" into field 32
  242.   set the castNum of sprite 31 to cast gTargetDLGcast
  243.   set the locV of sprite 31 to 240
  244.   puppetSprite(31, 1)
  245.   updateStage()
  246.   set the mouseDownScript to "DialogwithMouse"
  247. end
  248.  
  249. on ResetPageDialog
  250.   set the locV of sprite 31 to 1000
  251.   puppetSprite(31, 0)
  252.   updateStage()
  253. end
  254.  
  255. on ClickPageDialog
  256.   global gnumberofpages, gMachineType
  257.   puppetSound("Click")
  258.   set the castNum of sprite 30 to 30
  259.   updateStage()
  260.   repeat while the stillDown
  261.   end repeat
  262.   if field 32 <> EMPTY then
  263.     set thenewnumber to field 32
  264.     set theNum to the number of chars in thenewnumber
  265.     set theresult to "Success"
  266.     repeat with e = 1 to theNum
  267.       if "0123456789" contains char e of thenewnumber then
  268.         nothing()
  269.         next repeat
  270.       end if
  271.       set theresult to "Error"
  272.       exit repeat
  273.     end repeat
  274.     if theresult = "Error" then
  275.       alert("Error!!" & RETURN & "code : bad format.")
  276.       put gnumberofpages into field 32
  277.       set the castNum of sprite 30 to 9
  278.       updateStage()
  279.       puppetSound(0)
  280.     else
  281.       set thenumber to value(thenewnumber)
  282.       if thenumber = 0 then
  283.         alert("Error!!" & RETURN & "code : number of pages minimum number is 1.")
  284.         put gnumberofpages into field 32
  285.         set the castNum of sprite 30 to 9
  286.         updateStage()
  287.         puppetSound(0)
  288.       else
  289.         set gnumberofpages to thenumber
  290.         puppetSound(0)
  291.         set the mouseDownScript to EMPTY
  292.         go("Dialog-3M")
  293.       end if
  294.     end if
  295.   else
  296.     alert("Please type number of pages.")
  297.     put gnumberofpages into field 32
  298.     set the castNum of sprite 30 to 9
  299.     updateStage()
  300.     puppetSound(0)
  301.   end if
  302. end
  303.  
  304. on PrintSetUp
  305.   global gTargetPRNfile, gTargetTEXTprn, gNowMode, gnumberofpages, gMachineType, gDebugMode
  306.   set the castNum of sprite 27 to cast (gNowMode & "_PDLG")
  307.   set the locV of sprite 27 to 140
  308.   puppetSprite(27, 1)
  309.   updateStage()
  310.   set theErrorFlag to 0
  311.   if gDebugMode = 0 then
  312.     set theChObj to fileio(mnew, "read", the pathName & gTargetPRNfile)
  313.     if not objectp(theChObj) then
  314.       alert("Sorry!  not found PRNfile." & RETURN & "file :" && gTargetPRNfile)
  315.       set theErrorFlag to 1
  316.     else
  317.       theChObj(mdispose)
  318.     end if
  319.     if gTargetTEXTprn <> EMPTY then
  320.       set theChObj to fileio(mnew, "read", the pathName & gTargetTEXTprn)
  321.       if not objectp(theChObj) then
  322.         alert("Sorry!  not found second PRNfile." & RETURN & "file :" && gTargetTEXTprn)
  323.         set theErrorFlag to 1
  324.       else
  325.         theChObj(mdispose)
  326.       end if
  327.     end if
  328.   end if
  329.   if theErrorFlag = 1 then
  330.     set the locV of sprite 26 to 1000
  331.     set the locV of sprite 27 to 1000
  332.     puppetSprite(27, 0)
  333.     updateStage()
  334.     go("Home")
  335.   else
  336.     put "1/" & string(gnumberofpages) into field "PrintPageInfo"
  337.   end if
  338. end
  339.  
  340. on PrintEngine
  341.   global gTargetPRNfile, gTargetTEXTprn, gnumberofpages, gMachineType, gDebugMode, gNowMode, gTargetTEXTcount, gTargetDLGcast, gTableL, gxfname
  342.   if gMachineType = "PC" then
  343.     set gxfname to "MJPRINT.DLL"
  344.   else
  345.     set gxfname to "PRNXlib"
  346.   end if
  347.   if InitialPort() <> EMPTY then
  348.     ClosePrintEngine()
  349.   else
  350.     repeat with e = 1 to gnumberofpages
  351.       if gDebugMode = 1 then
  352.         set theInfoStr to "Machine/Table/TotalPRN :" && gMachineType & "/" & gNowMode & "/" & string(count(gTableL)) & RETURN & "MainPRN/SubPRN :" && gTargetPRNfile & "/" & gTargetTEXTprn & RETURN & "SubEntrys/PaperInfoCASTname :" && string(gTargetTEXTcount) & "/" & gTargetDLGcast & RETURN & "ActivePage/TotalPage :" & string(e) & "/" & string(gnumberofpages)
  353.         alert(theInfoStr)
  354.       else
  355.         if SendPrintData() = "EXIT" then
  356.           exit repeat
  357.         end if
  358.       end if
  359.       if e <> gnumberofpages then
  360.         puppetSound("Central Park 22k 30")
  361.         set the castNum of sprite 29 to 51
  362.         set the castNum of sprite 31 to 53
  363.         set the locV of sprite 29 to 279
  364.         set the locV of sprite 31 to 279
  365.         updateStage()
  366.         set theEndTime to the timer + 900
  367.         set theDialogRes to "NEXT"
  368.         repeat while the timer <= theEndTime
  369.           if the mouseDown = 1 then
  370.             set theDialogRes to InterceptPrint()
  371.             if theDialogRes <> EMPTY then
  372.               exit repeat
  373.             end if
  374.           end if
  375.         end repeat
  376.         set the locV of sprite 29 to 1000
  377.         set the locV of sprite 31 to 1000
  378.         updateStage()
  379.         if theDialogRes = "CANCEL" then
  380.           exit repeat
  381.         end if
  382.         puppetSound(0)
  383.         put string(e + 1) & "/" & string(gnumberofpages) into field "PrintPageInfo"
  384.       end if
  385.     end repeat
  386.     puppetSound(0)
  387.     ClosePrintEngine()
  388.   end if
  389. end
  390.  
  391. on InterceptPrint
  392.   if rollOver(28) then
  393.     if rollOver(29) then
  394.       set the castNum of sprite 29 to 52
  395.       updateStage()
  396.       return "CANCEL"
  397.     else
  398.       if rollOver(31) then
  399.         set the castNum of sprite 31 to 54
  400.         updateStage()
  401.         return "NEXT"
  402.       else
  403.         return EMPTY
  404.       end if
  405.     end if
  406.   else
  407.     beep()
  408.     return EMPTY
  409.   end if
  410. end
  411.  
  412. on ClosePrintEngine
  413.   global gPrintObj, gxfname
  414.   set the locV of sprite 27 to 1000
  415.   set the locV of sprite 26 to 1000
  416.   puppetSprite(27, 0)
  417.   if objectp(gPrintObj) then
  418.     gPrintObj(mdispose)
  419.   end if
  420.   closeXLib(the pathName & gxfname)
  421.   updateStage()
  422. end
  423.  
  424. on InitialPort
  425.   global gPrintObj, gMachineType, gxfname
  426.   if objectp(gPrintObj) then
  427.     gPrintObj(mdispose)
  428.   end if
  429.   if gMachineType = "PC" then
  430.     openXLib(the pathName & gxfname)
  431.     set gPrintObj to MJPRINT(mnew)
  432.     if not objectp(gPrintObj) then
  433.       alert("Sorry can't initial port.")
  434.       return "Error"
  435.     end if
  436.     return EMPTY
  437.   else
  438.     openXLib(the pathName & gxfname)
  439.     return EMPTY
  440.   end if
  441. end
  442.  
  443. on SendPrintData
  444.   global gPrintObj, gEjectSct, gTargetPRNfile, gMachineType
  445.   if gMachineType = "PC" then
  446.     if gPrintObj(mPrint, the pathName & gTargetPRNfile) <> 0 then
  447.       alert("Sorry! not found PRNfile." & RETURN & "file :" && gTargetPRNfile)
  448.       set theresult to "EXIT"
  449.     else
  450.       set theresult to EMPTY
  451.     end if
  452.   else
  453.     if macprintmj(the pathName & gTargetPRNfile) <> 0 then
  454.       alert("Sorry! not found PRNfile." & RETURN & "file :" && gTargetPRNfile)
  455.       set theresult to "EXIT"
  456.     else
  457.       set theresult to EMPTY
  458.     end if
  459.   end if
  460.   return theresult
  461. end
  462.